n=int(input("n="))
r=0;sum=0;i=0
while i<n:
    r=2 ** i
    sum = sum + r
    i=i+1
print('直到第{}格一共有{}粒米'.format(i, sum))
